<#import '/ftlLibrary/properteisVariable.ftl' as pv/>
<link href="assets/css/bootstrap-select.css" rel="stylesheet"/>
<link href="assets/css/front/listCommonStyle.css" rel="stylesheet"/>
<script src="assets/js/select2/select2.js"></script>
<style>
    td,th{
        height: 34.29px!important;
    }
    .tssStudentModal .modal-dialog{
        width: 60%;
    }
</style>
<div class="row" style="margin-left: 0px!important;">
    <div class="row" style="margin-bottom: 15px;font-size: 14px;margin-top: 15px">
                    <span style="padding-left: 24px">
                        请选择对应的退费项
                    </span>
    </div>
    <!-- 映射列表 -->
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <div class="widget flat radius-bordered" style="margin-top: 0;box-shadow:0px 0px 10px rgba(122,161,184,0.3);!important;">
            <div class="widget-body no-padding ">
                <div class="topPagingBar hidden">
                    <form>
                        <input type="hidden" name="checkboxId" id="checkboxId" value="0">
                    </form>
                </div>
                <div class="table-scrollable">
                    <!-- 数据表列信息列表 -->
                    <table class="table table-bordered dataTable" id="tableScrollTable">
                        <thead>
                        <tr>
                            <th title="选择" class="checkboxColumnTh  ">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox" class="chkAll">
                                        <span class="text"></span>
                                    </label>
                                </div>
                            </th>
                            <th title="属性名">序号</th>
                            <th title="合同编号">合同编号</th>
                            <th title="费用类型">费用类型</th>
                            <th title="费用明细">费用明细</th>
                            <th title="报名状态">报名状态</th>
                            <th title="费用金额(元)">费用金额(元)</th>
                            <th title="退费金额(元)">退费金额(元)</th>
                            <th title="退款编码">退款编码</th>
                            <th title="发起人">发起人</th>
                            <th title="退款状态">退款状态</th>
                            <th title="操作">操作</th>
                        </tr>
                        </thead>
                        <tbody >
                        <#if packageRefundMap?size==0>
                            <#if depositRefundMap?size==0>
                                <#if paymentRefundMap?size==0>
                                    <#if registeryFeeRefundMap?size==0>
                                        <tr>
                                            <td align="center">无数据</td>
                                        </tr>
                                    </#if>
                                </#if>
                            </#if>
                        </#if>
                        <#list packageRefundMap as data>
                            <tr>
                                <td class="checkboxColumnTd">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" class="chk" name="id" value="${data.id}">
                                            <span class="text"></span>
                                        </label>
                                    </div>
                                </td>
                                <td>${(data.index???string(data.index?html,"未设置"))!'未设置'}</td>
                                <td>${(data.contractNumber???string(data.contractNumber?html,"未设置"))!'未设置'}</td>
                                <td>${(data.paymentType???string(data.paymentType?html,"未设置"))!'未设置'}</td>
                                <td>${(data.packageName???string(data.packageName?html,"未设置"))!'未设置'}</td>
                                <td>${(data.applyStatus???string(data.applyStatus?html,"未设置"))!'未设置'}</td>
                                <td>${(data.sumPrice???string(data.sumPrice?html,"未设置"))!'未设置'}</td>
                                <td>${(data.returnAmout???string(data.returnAmout?html,"未设置"))!'未设置'}</td>
                                <td>${(data.refundCode???string(data.refundCode?html,"未设置"))!'未设置'}</td>
                                <td>${(data.userName???string(data.userName?html,"未设置"))!'未设置'}</td>
                                <td>${(data.refundStatus???string(data.refundStatus?html,"未设置"))!'未设置'}</td>
                                <td> <a href="javascript:void(0)"  class="refundChooseTypeTd" paymentType="${data.paymentType}"
                                        packageId="${data.memberPackageId}" stuId="${stuId}" paymentId="${data.id}">申请退费</a></td>
                            </tr>
                        </#list>
                        <#list depositRefundMap as data>
                            <tr>
                                <td class="checkboxColumnTd">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" class="chk" name="id" value="${data.id}">
                                            <span class="text"></span>
                                        </label>
                                    </div>
                                </td>
                                <td>${(data.index???string(data.index?html,"未设置"))!'未设置'}</td>
                                <td>${(data.contractNumber???string(data.contractNumber?html,"未设置"))!'未设置'}</td>
                                <td>${(data.paymentType???string(data.paymentType?html,"未设置"))!'未设置'}</td>
                                <td>-</td>
                                <td>${(data.applyStatus???string(data.applyStatus?html,"未设置"))!'未设置'}</td>
                                <td>${(data.amount???string(data.amount?html,"未设置"))!'未设置'}</td>
                                <td>${(data.returnAmout???string(data.returnAmout?html,"未设置"))!'未设置'}</td>
                                <td>${(data.refundCode???string(data.refundCode?html,"未设置"))!'未设置'}</td>
                                <td>${(data.userName???string(data.userName?html,"未设置"))!'未设置'}</td>
                                <td>${(data.refundStatus???string(data.refundStatus?html,"未设置"))!'未设置'}</td>
                                <td> <a href="javascript:void(0)"  class="refundChooseTypeTd" paymentType="${data.paymentType}"
                                        packageId="${data.memberPackageId}" stuId="${stuId}" paymentId="${data.id}">申请退费</a></td>
                            </tr>
                        </#list>
                        <#list paymentRefundMap as data>
                            <tr>
                                <td class="checkboxColumnTd">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" class="chk" name="id" value="${data.id}">
                                            <span class="text"></span>
                                        </label>
                                    </div>
                                </td>
                                <td>${(data.index???string(data.index?html,"未设置"))!'未设置'}</td>
                                <td>${(data.contractNumber???string(data.contractNumber?html,"未设置"))!'未设置'}</td>
                                <td>${(data.paymentType???string(data.paymentType?html,"未设置"))!'未设置'}</td>
                                <td>-</td>
                                <td>${(data.applyStatus???string(data.applyStatus?html,"未设置"))!'未设置'}</td>
                                <td>${(data.sumAmount???string(data.sumAmount?html,"未设置"))!'未设置'}</td>
                                <td>${(data.returnAmout???string(data.returnAmout?html,"未设置"))!'未设置'}</td>
                                <td>${(data.refundCode???string(data.refundCode?html,"未设置"))!'未设置'}</td>
                                <td>${(data.userName???string(data.userName?html,"未设置"))!'未设置'}</td>
                                <td>${(data.refundStatus???string(data.refundStatus?html,"未设置"))!'未设置'}</td>
                                <td> <a href="javascript:void(0)"  class="refundChooseTypeTd" paymentType="${data.paymentType}"
                                        packageId="${data.memberPackageId}" stuId="${stuId}" paymentId="${data.id}">申请退费</a></td>

                            </tr>
                        </#list>
                        <#list registeryFeeRefundMap as data>
                            <tr>
                                <td class="checkboxColumnTd">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" class="chk" name="id" value="${data.id}">
                                            <span class="text"></span>
                                        </label>
                                    </div>
                                </td>
                                <td>${(data.index???string(data.index?html,"未设置"))!'未设置'}</td>
                                <td>${(data.contractNumber???string(data.contractNumber?html,"未设置"))!'未设置'}</td>
                                <td>${(data.paymentType???string(data.paymentType?html,"未设置"))!'未设置'}</td>
                                <td>-</td>
                                <td>${(data.applyStatus???string(data.applyStatus?html,"未设置"))!'未设置'}</td>
                                <td>${(data.amount???string(data.amount?html,"未设置"))!'未设置'}</td>
                                <td>${(data.returnAmout???string(data.returnAmout?html,"未设置"))!'未设置'}</td>
                                <td>${(data.refundCode???string(data.refundCode?html,"未设置"))!'未设置'}</td>
                                <td>${(data.userName???string(data.userName?html,"未设置"))!'未设置'}</td>
                                <td>${(data.refundStatus???string(data.refundStatus?html,"未设置"))!'未设置'}</td>
                                <td> <a href="javascript:void(0)"  class="refundChooseTypeTd" paymentType="${data.paymentType}"
                                        packageId="${data.memberPackageId}" stuId="${stuId}" paymentId="${data.id}">申请退费</a></td>

                            </tr>
                        </#list>
                       <!-- <tr>
                            <td class="checkboxColumnTd">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox" class="chk" name="id" value="${data.id}">
                                        <span class="text"></span>
                                    </label>
                                </div>
                            </td>
                            <td>2</td>
                            <td>特殊退费</td>
                            <td>-</td>
                            <td>-</td>
                            <td>-</td>
                            <td>-</td>
                            <td>-</td>
                            <td>-</td>
                            <td>-</td>
                            <td> <a href="javascript:void(0)"  onclick="Refund(this)" paymentType="7"
                                    packageId="${data.memberPackageId}" stuId="${stuId}" paymentId="${data.id}">申请退费</a></td>

                        </tr>-->
                        </tbody>
                    </table>
                </div>
            </div>
        </div>


    </div>
</div>
<script>
    $(".selectpicker").select2();

// 退费
    $("#tableScrollTable").on("click",".refundChooseTypeTd",function () {
        var paymentType = $(this).attr("paymentType");
        var packageId = $(this).attr("packageId");
        var stuId = $(this).attr("stuId");
        var paymentId = $(this).attr("paymentId");
        console.log(paymentType);
        console.log(packageId);
        ajaxRequest("tssMemberReturnPremiumController/toRefundApplication.do", {
            paymentType: paymentType,
            packageId: packageId,
            stuId:stuId,
            paymentId:paymentId
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "退费申请",
                className: 'myDialog familyMemberDialog',
            });
            $(".modal-header").find(".bootbox-close-button").removeClass("close");
            $(".modal-header").find(".bootbox-close-button").html("");
        }, function () {
            ajaxError("加载页面失败!")
        }, "post", "html")
    })
</script>